package com.kanshu.ksgb.fastread.doudou.common.supertextview;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;

import com.kanshu.ksgb.fastread.doudou.common.util.DisplayUtils;


/**
 * Created by wcy on 2017\9\8 0008.
 */

public class LeanTextView extends SuperTextView {
    public LeanTextView(Context context) {
        super(context);
    }

    public LeanTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public LeanTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.save();
        canvas.rotate(45, getMeasuredWidth() / 2, getMeasuredHeight() / 2);
        canvas.translate(0, DisplayUtils.dip2px(getContext(), -4));
        super.onDraw(canvas);
        canvas.restore();
    }
}
